The fastest way for you to get this application up and running on Azure is to follow the procedure below.
Note In GitHub there is even a easier way than the one below:
- From the rpothin/servicebus-csharp-function-dataverse GitHub repository, click on the Use this template button
- Select the Open in a codespace option
- Go directly to the step 3 of this section
- Open a terminal, create a new empty folder, and change into it
- Run the following command to initialize the project
azd init --template rpothin/servicebus-csharp-function-dataverse
You will be prompted for the following information:
Environment Name
: This will be used in the name of the the resource group and the resources that will be created in Azure. This name should be unique within your Azure subscription.Azure Location
: The Azure location where your resources will be deployed.Azure Subscription
: The Azure Subscription where your resources will be deployed.
- Run the following command to finalize the initialization of the project
# For Windows
.\scripts\post-init-setup.ps1
# For Linux/MacOS
pwsh scripts/post-init-setup.ps1
# You can add the "-verbose" parameter to get more details during the execution
Note This PowerShell script will:
- create an application registration in Azure AD for the Azure deployment from GitHub
- create an application registration in Azure AD for the communication from the Azure Functions application to the Power Platform / Dataverse environment
- prompt for the URL of a Dataverse environment (guide to get it) or offer to create one based on the element in the Dataverse environment configuration file
- register the second application registration created in Azure AD as an application user in the considered Power Platform / Dataverse environment with the
Service Reader
security role
- Run the following command to provision Azure resources, and deploy the application code
Note If you use 2 different accounts for the configuration of the Azure and Power Platform part, you will need to connect again with your "Azure" account before running the following command. You can do that using the
az login --use-device-code
command.
azd up
Note This may take a while to complete as it executes two commands:
azd provision
(provisions Azure resources) andazd deploy
(deploys application code). You will see a progress indicator as it provisions and deploys your application.
When azd up
is complete it will output the following URLs:
- Azure Portal link to view resources
- Azure Functions application