Azure Provider Overview
The officially supported Nitric Azure Provider.
provider: nitric/azure@latest
See the Overview page for general information on Nitric Pulumi providers.
Nitric runs services (APIs, Schedules and Topic Subscribers) on Azure Container Apps, which is unavailable in a small number of regions.
The Azure provider is supported by the Nitric SDKs and CLI by default. However, credentials for an Azure account will be required when using the up command from the CLI.
Azure Credentials
The Nitric CLI uses the standard Azure credentials to authenticate with Azure. If you've set up local credentials for the Azure CLI or an SDK previously, these settings should work without modification.
If you're setting up your credentials for the first time, simply run azure login command and finish the login via your browser.
az login
Verify the Azure CLI install -
az -v
See Azure documentation for full details on credentials and configuration.
Azure CLI Installation
Installing the Azure CLI assists with credentials setup. You can install it using these summarized instructions, for more options see the Microsoft docs.
Download & install the latest CLI release.
Locating deployed resources
This Nitric Azure provider deploys resources for a stack into a resource group dedicated to that stack. You can either use one your already have by configuring it in the stack configuration or let Nitric create one for you.
Once a stack has been deployed to Azure it's resource group should be present in the Resource groups page of the portal. Assuming it was deployed to a subscription you have access to.
Resource groups are conventionally named <project-name>-<stack-name>-<randomId>
In this example the project name is api-testing
and the stack name is az
.
More recent versions of the Nitric Azure provider display a direct link to the resource group in output from nitric up
.
Example:
Resource Group:──────────────https://portal.azure.com/#@your-tenant-id/resource/subscriptions/your-subscription-id/resourceGroups/your-resource-group/overviewAPI Endpoints:──────────────main: https://example-api865cb.azure-api.net
Stack Configuration
# The provider to use and it's published version# See releases:# https://github.com/nitrictech/nitric/tagsprovider: nitric/azure@latest# The target Azure region to deploy to# See available regions:# https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=container-appsregion: my-azure-stack-region# Deploy into an existing resource group# Available since v1.11.0# ⚠️ Changing this property post-deployment is a destructive operationresource-group: my-azure-resource-group# Org to associate deployed API Management services withorg: example-org# Admin email to associate deployed API Management services withadminemail: test@example.com# All configuration below is optional# Apply configuration to nitric APIsapis:# Target an API by its nitric namemy-api:# provide domains to be used for the apidescription: An Azure API# Configure your deployed servicesconfig:# How services without a type will be deployeddefault:# configure a sample rate for telemetry (between 0 and 1) e.g. 0.5 is 50%telemetry: 0# configure services to deploy to Google Cloud Run# see: https://learn.microsoft.com/en-us/azure/container-apps/containers#configurationcontainerapps: # Available since v0.26.0# set 1/4 vCPUcpu: 0.25# set 0.5GB of RAMmemory: 0.5# The minimum number of instances to scale down tomin-replicas: 0# The maximum number of instances to scale up tomax-replicas: 10# Additional deployment types# You can target these types by setting a `type` in your project configurationbig-service:telemetry: 0containerapps:memory: 1min-replicas: 2max-replicas: 100