Zelfstudie: API's voor analyseverbruikszones gebruiken

Deze zelfstudie laat zien hoe u de ACZ-beheer-API's (Analytics Consumption Zone) gebruikt in Azure Data Manager for Energy. U maakt, vermeldt, ophaalt en verwijdert ACZ-exemplaren met behulp van cURL.

Belangrijk

De verbruikszone voor analyse is momenteel beschikbaar als preview-versie. Zie Aanvullende gebruiksvoorwaarden voor Microsoft Azure previews voor juridische voorwaarden die van toepassing zijn op Azure functies die zich in bèta, preview of anderszins nog niet in algemene beschikbaarheid bevinden.

Tijdens de preview is ACZ alleen beschikbaar op instanties van de developer-laag en is het gebruik van acceptatielijsten vereist. Volg de richtlijnen in De verbruikszone voor analyse inschakelen en neem contact op met uw Microsoft vertegenwoordiger.

In deze handleiding leer je hoe je:

  • Maak een ACZ-exemplaar.
  • Alle ACZ-exemplaren in een gegevenspartitie weergeven.
  • Details van een specifiek ACZ-exemplaar ophalen.
  • Een ACZ-exemplaar verwijderen.

Prerequisites

Tip

De API interactief verkennen: U kunt de volledige ACZ API-specificatie en testeindpunten bekijken met behulp van de Swagger UI op https://{instance-name}.energy.azure.com/api/acz/v1/docs. Vervang door {instance-name} de naam van uw Azure Data Manager for Energy Instance.

De details van uw Azure Data Manager for Energy-exemplaar ophalen

Verzamel deze gegevens van uw Azure Data Manager for Energy-exemplaar in de Azure-portal.

Voordat u begint

De codevoorbeelden in deze tutorial gebruiken plaatsaanduidingswaarden in de notatie {curly-braces}. Vervang deze tijdelijke aanduidingen door uw werkelijke waarden wanneer u de opdrachten uitvoert.

Voor alle API-aanroepen is verificatie vereist. De Bash- en PowerShell-voorbeelden laten zien hoe je inline tokens genereert met de Azure CLI. Zie Een verificatietoken genereren voor alternatieve verificatiemethoden.

Een ACZ-exemplaar maken

Gebruik de Create ACZ API om een nieuw ACZ-exemplaar op te zetten voor een datapartitie.

API

POST /api/acz/v1/aczs

Belangrijkste punten

  • Maximaal drie ACZ-exemplaren per gegevenspartitie (preview-limiet).
  • De ACZ-naam moet uniek zijn binnen de partitie.
  • De door de gebruiker toegewezen beheerde identiteit moet:
    • Toegewezen aan uw Azure Data Manager voor Energieresource (zie Gebruikszone analyse inschakelen).
    • De rol 'Storage Blob Data Contributor' is toegewezen aan het Azure Data Lake Storage Gen2-opslagaccount als bestemming.
  • Een Data Lake Storage Gen2-opslagaccount waarvoor een hiërarchische naamruimte is ingeschakeld, is vereist.
# Get auth app ID for your Azure Data Manager for Energy instance
AUTH_APP_ID=$(az resource show --ids /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OpenEnergyPlatform/energyServices/{adme-instance-name} --query properties.authAppId -o tsv)

# Get access token
TOKEN=$(az account get-access-token --resource $AUTH_APP_ID --query accessToken -o tsv)

# Create ACZ instance
curl --request POST \
  --url https://{base-url}/api/acz/v1/aczs \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --header 'data-partition-id: {data-partition-id}' \
  --data '{
    "name": "{acz-name}",
    "aczType": "{acz-type}",
    "targetFormat": "DELTA_PARQUET",
    "allCatalogSync": false,
    "sink": {
      "storageType": "microsoft.storage/storageaccounts",
      "storageId": "{storage-resource-id}",
      "basePath": "{base-path}"
    },
    "configuration": {
      "catalogKinds": ["{catalog-kinds}"],
      "wellboreDDMSKinds": ["{wellbore-ddms-kinds}"]
    }
  }'

Vervang de plaatsaanduidingen

Tijdelijke aanduiding Description
{subscription-id} Abonnements-id waarin uw Azure Data Manager for Energy-exemplaar zich bevindt.
{resource-group} Resourcegroep die uw Azure Data Manager for Energy-exemplaar bevat.
{adme-instance-name} De naam van uw Azure Data Manager for Energy Instance.
{base-url} De URL van uw Azure Data Manager for Energy Instance (bijvoorbeeldmyinstance.energy.azure.com).
{data-partition-id} Uw gegevenspartitie-id (bijvoorbeeld opendes).
{acz-name} Weergavenaam voor het ACZ-exemplaar (bijvoorbeeld my-acz-wells-and-logs1-100 tekens).
{acz-type} Optioneel: LATEST_VERSION (standaard) exporteert alleen de nieuwste versie en ALL_VERSIONS exporteert alle versies.
{storage-resource-id} Azure resource-ID van het Data Lake Storage Gen2-opslagaccount van het doel (bijvoorbeeld, /subscriptions/xxx.../storageAccounts/mystorageacct).
{base-path} Optioneel: basispad binnen het opslagaccount voor ACZ-gegevensuitvoer (bijvoorbeeld acz-output).
allCatalogSync Optioneel (standaardinstelling: false). Wanneer dit is ingesteld true, exporteert u alle catalogustypen uit de partitie. Gespecificeerd buiten de configuration-sectie. Wanneer true, catalogKinds en wellboreDDMSKinds in de configuratie worden genegeerd voor catalogusgegevens.
{catalog-kinds} Optioneel: OSDU®-catalogus kind-strings om te synchroniseren (bijvoorbeeld ["osdu:wks:master-data--Well:*"]). Genegeerd als allCatalogSynctrue is.
{wellbore-ddms-kinds} Optioneel: Wellbore Domain Gegevensbeheer Service (DDMS) soort tekenreeksen die moeten worden gesynchroniseerd (bijvoorbeeld["osdu:wks:work-product-component--WellLog:*"]). Bestandsdownloads vinden alleen plaats voor typen die hier zijn vermeld.

Tip

Alle catalogusgegevens exporteren: Stel "allCatalogSync": true (buiten de configuration sectie) in om alle catalogustypen uit uw gegevenspartitie te exporteren. Wanneer deze optie is ingeschakeld, worden de catalogKinds en wellboreDDMSKinds matrices in de configuratie genegeerd voor catalogusgegevens. Bulkbestanden van Wellbore DDMS worden nog steeds alleen gedownload voor soorten die worden vermeld in wellboreDDMSKinds.

U moet ten minste een van de volgende opties opgeven:

  • Instellen "allCatalogSync": true (buiten de configuratie).
  • Geef in de configuratie een catalogKinds array op met ten minste één kindpatroon.
  • Geef in de configuratie een wellboreDDMSKinds array op met ten minste één typepatroon.

Voorbeeldreactie (201 Aangemaakt)

{
  "aczId": "acz-abc123def456",
  "name": "my-acz-wells-and-logs",
  "status": "ACTIVE",
  "aczType": "LATEST_VERSION",
  "targetFormat": "DELTA_PARQUET",
  "sink": {
    "storageType": "microsoft.storage/storageaccounts",
    "storageId": "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account}",
    "basePath": "acz-output"
  },
  "allCatalogSync": false,
  "configuration": {
    "catalogKinds": [
      "osdu:wks:master-data--Well:*",
      "osdu:wks:reference-data--UnitOfMeasure:*"
    ],
    "wellboreDDMSKinds": [
      "osdu:wks:work-product-component--WellLog:*"
    ]
  },
  "historicalSnapshotStatus": "PROCESSING",
  "createdTs": "2026-03-31T10:00:00Z",
  "updatedTs": "2026-03-31T10:00:00Z",
  "createdBy": "user@contoso.com"
}

Nadat u het ACZ-exemplaar hebt gemaakt, wordt de historische momentopname met de PROCESSING status gestart. Gebruik de Get ACZ-API om de status te controleren.

ACZ-exemplaren weergeven

Gebruik de API List ACZs om alle ACZ-exemplaren op te halen in een gegevenspartitie.

API

GET /api/acz/v1/aczs

# Get auth app ID for your Azure Data Manager for Energy instance
AUTH_APP_ID=$(az resource show --ids /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OpenEnergyPlatform/energyServices/{adme-instance-name} --query properties.authAppId -o tsv)

# Get access token
TOKEN=$(az account get-access-token --resource $AUTH_APP_ID --query accessToken -o tsv)

# List ACZ instances
curl --request GET \
  --url https://{base-url}/api/acz/v1/aczs \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Accept: application/json' \
  --header 'data-partition-id: {data-partition-id}'

Vervang de plaatsaanduidingen

Tijdelijke aanduiding Description
{subscription-id} Abonnements-id waarin uw Azure Data Manager for Energy-exemplaar zich bevindt.
{resource-group} Resourcegroep die uw Azure Data Manager for Energy-exemplaar bevat.
{adme-instance-name} De naam van uw Azure Data Manager for Energy Instance.
{base-url} De URL van uw Azure Data Manager for Energy Instance (bijvoorbeeldmyinstance.energy.azure.com).
{data-partition-id} Uw gegevenspartitie-id (bijvoorbeeld opendes).

Voorbeeldantwoord (200 OK)

{
  "items": [
    {
      "aczId": "acz-abc123def456",
      "name": "my-acz-wells-and-logs",
      "status": "ACTIVE",
      "aczType": "LATEST_VERSION",
      "targetFormat": "DELTA_PARQUET",
      "sink": {
        "storageType": "microsoft.storage/storageaccounts",
        "storageId": "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account}",
        "basePath": "acz-output"
      },
      "allCatalogSync": false,
      "configuration": {
        "catalogKinds": [
          "osdu:wks:master-data--Well:*"
        ]
      },
      "historicalSnapshotStatus": "PROCESSING",
      "createdTs": "2026-03-31T10:00:00Z",
      "updatedTs": "2026-03-31T10:00:00Z",
      "createdBy": "user@contoso.com"
    },
    {
      "aczId": "acz-xyz789ghi012",
      "name": "all-catalog-sync-example",
      "status": "ACTIVE",
      "aczType": "LATEST_VERSION",
      "targetFormat": "DELTA_PARQUET",
      "sink": {
        "storageType": "microsoft.storage/storageaccounts",
        "storageId": "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account}",
        "basePath": "acz-output"
      },
      "allCatalogSync": true,
      "configuration": {
        "wellboreDDMSKinds": [
          "osdu:wks:work-product-component--WellLog:*"
        ]
      },
      "historicalSnapshotStatus": "COMPLETED",
      "createdTs": "2026-03-31T09:00:00Z",
      "updatedTs": "2026-03-31T09:45:00Z",
      "createdBy": "user@contoso.com"
    }
  ],
  "count": 2
}

Het antwoord bevat alle ACZ-exemplaren in elke status: ACTIVE, FAILEDof ACCESS_DENIED. Dit antwoord toont twee ACZ-exemplaren: één met selectieve catalogussynchronisatie (allCatalogSync: false met specifieke soorten) en een andere met het exporteren allCatalogSync: true van alle catalogustypen.

ACZ-details ophalen

Gebruik de Get ACZ-API om details op te halen voor een specifiek ACZ-exemplaar.

API

GET /api/acz/v1/aczs/{acz-id}

# Get auth app ID for your Azure Data Manager for Energy instance
AUTH_APP_ID=$(az resource show --ids /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OpenEnergyPlatform/energyServices/{adme-instance-name} --query properties.authAppId -o tsv)

# Get access token
TOKEN=$(az account get-access-token --resource $AUTH_APP_ID --query accessToken -o tsv)

# Get ACZ details
curl --request GET \
  --url https://{base-url}/api/acz/v1/aczs/{acz-id} \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Accept: application/json' \
  --header 'data-partition-id: {data-partition-id}'

Vervang de plaatsaanduidingen

Tijdelijke aanduiding Description
{subscription-id} Abonnements-id waarin uw Azure Data Manager for Energy-exemplaar zich bevindt.
{resource-group} Resourcegroep die uw Azure Data Manager for Energy-exemplaar bevat.
{adme-instance-name} De naam van uw Azure Data Manager for Energy Instance.
{base-url} De URL van uw Azure Data Manager for Energy Instance (bijvoorbeeldmyinstance.energy.azure.com).
{data-partition-id} Uw gegevenspartitie-id (bijvoorbeeld opendes).
{acz-id} ACZ-id uit het antwoord op 'Maken' of 'Lijst' (bijvoorbeeld acz-abc123def456).

Voorbeeldreactie (200 OK)

{
  "aczId": "acz-abc123def456",
  "name": "my-acz-wells-and-logs",
  "status": "ACTIVE",
  "aczType": "LATEST_VERSION",
  "targetFormat": "DELTA_PARQUET",
  "sink": {
    "storageType": "microsoft.storage/storageaccounts",
    "storageId": "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account}",
    "basePath": "acz-output"
  },
  "allCatalogSync": false,
  "configuration": {
    "catalogKinds": [
      "osdu:wks:master-data--Well:*",
      "osdu:wks:reference-data--UnitOfMeasure:*"
    ],
    "wellboreDDMSKinds": [
      "osdu:wks:work-product-component--WellLog:*"
    ]
  },
  "historicalSnapshotStatus": "COMPLETED",
  "createdTs": "2026-03-31T10:00:00Z",
  "updatedTs": "2026-03-31T10:30:00Z",
  "createdBy": "user@contoso.com"
}

Om ACZ-provisioning bij te houden, controleert u de velden status en historicalSnapshotStatus.

Een ACZ-exemplaar verwijderen

Gebruik de Delete ACZ-API om een ACZ-configuratie te verwijderen.

API

DELETE /api/acz/v1/aczs/{acz-id}

Warning

Deze verwijderactie kan niet ongedaan worden gemaakt. Hiermee verwijdert u alle ACZ-configuratie en stopt u de synchronisatie. Gegevens die al in het doel-Data Lake Storage Gen2 opslagaccount staan, blijven intact.

# Get auth app ID for your Azure Data Manager for Energy instance
AUTH_APP_ID=$(az resource show --ids /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OpenEnergyPlatform/energyServices/{adme-instance-name} --query properties.authAppId -o tsv)

# Get access token
TOKEN=$(az account get-access-token --resource $AUTH_APP_ID --query accessToken -o tsv)

# Delete ACZ instance
curl --request DELETE \
  --url https://{base-url}/api/acz/v1/aczs/{acz-id} \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Accept: application/json' \
  --header 'data-partition-id: {data-partition-id}'

Vervang de plaatsaanduidingen

Tijdelijke aanduiding Description
{subscription-id} Abonnements-id waarin uw Azure Data Manager for Energy-exemplaar zich bevindt.
{resource-group} Resourcegroep die uw Azure Data Manager for Energy-exemplaar bevat.
{adme-instance-name} De naam van uw Azure Data Manager for Energy Instance.
{base-url} De URL van uw Azure Data Manager for Energy Instance (bijvoorbeeldmyinstance.energy.azure.com).
{data-partition-id} Uw gegevenspartitie-id (bijvoorbeeld opendes).
{acz-id} ACZ-id uit de Create- of List-respons (bijvoorbeeld acz-abc123def456).

Voorbeeldantwoord (204 Geen inhoud)

Een geslaagde verwijdering retourneert HTTP 204 zonder antwoordtekst. De ACZ-status verandert in DELETING terwijl het opschonen wordt uitgevoerd.

Foutreacties

De ACZ-API's retourneren de volgende foutcodes.

HTTP-status Description
400 Onjuist verzoek. Controleer de aanvraagbody op validatiefouten.
401 Onbevoegd. Het Bearer-token ontbreekt of is ongeldig.
403 Verboden. De gebruiker behoort niet tot de vereiste rechtengroep.
404 Niet gevonden. De opgegeven ACZ-id bestaat niet.
422 Validatie is mislukt. De hoofdtekst van de aanvraag bevat waarden die niet geldig zijn.
500 Interne serverfout. Neem contact op met de ondersteuning als deze fout zich blijft voordoen.