Provision NoSQL create-index samples
UTILITY SKILL. INVOKES: azd auth login, azd env, and azd up.
USE FOR:
"Provision the create-index samples", "deploy create-index resources", "run azd up for create-index", "restore create-index sample data", or "initialize the create-index environment".
DO NOT USE FOR:
Running the samples, validating sample output, deleting Azure resources, or cleaning generated files.
Run
Work from the repository root. Before running any provisioning command, ask the user to authenticate with Azure Developer CLI and confirm the target subscription:
Run
azd auth loginin your terminal, then tell me which Azure subscription should receive these resources. Do not provide credentials or tokens in chat.
After the user confirms authentication and the subscription, select or create the active azd environment with the intended subscription and location. For a new environment:
azd env new <environment-name> --subscription <subscription-id> --location <azure-region>
For an existing environment, verify its configured subscription:
azd env get-values
If the active environment is not configured for the intended subscription, update it before continuing:
azd env set AZURE_SUBSCRIPTION_ID <subscription-id>
Set the canonical create-index database setting before provisioning:
azd env set AZURE_COSMOSDB_CREATE_INDEX_DATABASENAME HotelsCreateIndex
azd env get-value AZURE_COSMOSDB_CREATE_INDEX_DATABASENAME
Do not continue unless azd env get-value returns HotelsCreateIndex for the
active environment.
Provision the infrastructure and run the repository postprovision hook:
azd up
azd up provisions the resources defined by this repository and runs the postprovision hook from azure.yaml. The hook restores the region-based JSON files into the five nosql-create-index-* sample data directories.
Success criteria
Treat the operation as successful only when:
azd auth logincompleted successfully for the user's intended tenant.- The active
azdenvironment targets the intended subscription and region. AZURE_COSMOSDB_CREATE_INDEX_DATABASENAMEis set toHotelsCreateIndexin the activeazdenvironment beforeazd up.azd upexits with code0.- The postprovision hook completes successfully.
- The copied files
HotelsData_toCosmosDB_byRegion.jsonandHotelsData_toCosmosDB_Vector_byRegion.jsonexist under each create-index sample'sdatadirectory.
If provisioning fails, report the failing command and its error. Do not retry against a different subscription or modify Azure resources manually without user confirmation.