xtrareports-devexpress-dot-xtrareports-dot-web-dot-azure-dot-iazureresourceprovisionservice.md
Creates and configures the required resources in Azure Storage data services and in the Service Bus.
Namespace : DevExpress.XtraReports.Web.Azure
Assembly : DevExpress.XtraReports.v25.2.Web.Azure.dll
NuGet Package : DevExpress.Web.Reporting.Azure
Task CreateRequiredResourcesAsync()
Function CreateRequiredResourcesAsync As Task
| Type | Description |
|---|---|
| Task |
A task that creates and configures resources.
|
For Azure service integrations, obtain an instance of IAzureResourceProvisionService from the ServiceCollection and call the CreateRequiredResourcesAsync method to create and configure the required resources in Azure Storage data services and optionally in the Service Bus (depending on your configuration):
ASP.NET Core Applications
using DevExpress.XtraReports.Web.Azure;
//...
using(var serviceScope = app.Services.CreateScope()) {
var azureResourceInitializer = serviceScope.ServiceProvider.GetService<IAzureResourceProvisionService>();
azureResourceInitializer.CreateRequiredResourcesAsync().GetAwaiter().GetResult();
}
ASP.NET MVC and Web Forms Applications
using DevExpress.XtraReports.Web.Azure;
//...
protected void Application_Start(object sender, EventArgs e) {
//...
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize();
// DevExpress.XtraReports.Web.ASPxReportDesigner.StaticInitialize();
((IAzureResourceProvisionService)DefaultWebDocumentViewerContainer.Current.GetService(typeof(IAzureResourceProvisionService))).CreateRequiredResourcesAsync().GetAwaiter().GetResult();
}
Imports DevExpress.XtraReports.Web.Azure
'...
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
'...
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize()
' DevExpress.XtraReports.Web.ASPxReportDesigner.StaticInitialize();
DirectCast(DefaultWebDocumentViewerContainer.Current.GetService(GetType(IAzureResourceProvisionService)), IAzureResourceProvisionService).CreateRequiredResourcesAsync().GetAwaiter().GetResult()
See Also
Microsoft Azure Integration Specifics
IAzureResourceProvisionService Interface