You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/programmable-connectivity/azure-programmable-connectivity-create-gateway.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Create an Azure Programmable Connectivity Gateway
3
-
description: In this guide, learn how to create an APC gateway.
3
+
description: In this guide, learn how to create an APC Gateway.
4
4
author: anzaman
5
5
ms.author: alzam
6
6
ms.service: azure-programmable-connectivity
@@ -9,29 +9,34 @@ ms.date: 07/22/2024
9
9
ms.custom: template-overview
10
10
---
11
11
12
-
# Quickstart: Create an APC gateway
12
+
# Quickstart: Create an APC Gateway
13
13
14
14
In this quickstart, you learn how to create an Azure Programmable Connectivity (APC) gateway and subscribe to API plans in the Azure portal.
15
15
16
16
> [!NOTE]
17
-
> Deleting and modifying existing APC gateways is not supported during the preview. Please open a support ticket in the Azure Portal if you need to delete an APC Gateway.
17
+
> Deleting and modifying existing APC Gateways is not supported during the preview. Please open a support ticket in the Azure Portal if you need to delete an APC Gateway.
18
+
>
19
+
20
+
> [!NOTE]
21
+
> Moving an APC Gateway to a different resource group is not supported. If you need to move an APC Gateway to a different resource group, you must delete it and recreate it.
18
22
>
19
23
20
24
## Prerequisites
21
25
22
26
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
27
+
- Register your Azure subscription with the provider `Microsoft.ProgrammableConnectivity`, following [these instructions](/azure/azure-resource-manager/management/resource-providers-and-types)
23
28
24
29
### Sign in to the Azure portal
25
30
26
31
Sign in to the [Azure portal](https://portal.azure.com).
27
32
28
-
### Create a new APC gateway
33
+
### Create a new APC Gateway
29
34
30
35
1. In the Azure portal, Search for **APC Gateways** and then select **Create**.
31
36
32
37
:::image type="content" source="media/search.jpg" alt-text="Screenshot of Azure portal showing the search box." lightbox="media/search.jpg":::
33
38
34
-
1. Select the **Subscription**, **Resource Group** and **Region** for the gateway.
39
+
1. Select the **Subscription**, **Resource Group**, and **Region** for the gateway.
35
40
36
41
:::image type="content" source="media/create.jpg" alt-text="Screenshot of the create gateway page in Azure portal." lightbox="media/create.jpg":::
37
42
@@ -50,9 +55,9 @@ Sign in to the [Azure portal](https://portal.azure.com).
50
55
51
56
### Provide application details
52
57
53
-
In order to use the operators API, you must provide extra details, which will be shared with the operator.
58
+
In order to use the operators' APIs, you must provide extra details, which are shared with the operators.
54
59
55
-
1. Fill out the Application name, Application description, Legal entity, Tax number and the privacy manger's email address in the text boxes.
60
+
1. Fill out the Application name, Application description, Legal entity, Tax number, and the privacy manager's email address in the text boxes.
56
61
57
62
:::image type="content" source="media/app-details.jpg" alt-text="Screenshot of the application details page in the Azure portal." lightbox="media/app-details.jpg":::
58
63
@@ -66,11 +71,19 @@ On the **Terms and Conditions** page.
66
71
67
72
:::image type="content" source="media/terms.jpg" alt-text="Screenshot of the terms and conditions page in the Azure portal." lightbox="media/terms.jpg":::
68
73
69
-
1. Repeat the above step for each line.
74
+
1. Repeat for each line.
70
75
1. Click **Next**.
71
76
72
77
### Verify details and create
73
78
74
79
Once you see the **Validation passed** message, click **Create**.
75
80
76
81
:::image type="content" source="media/verify-create.jpg" alt-text="Screenshot of the verify and create page in Azure portal." lightbox="media/verify-create.jpg":::
82
+
83
+
### Wait for approval
84
+
85
+
On clicking **Create** your APC Gateway and one or more Operator API Connections are created. Each Operator API Connection represents a connection between your APC Gateway and a particular API at a particular operator.
86
+
87
+
Operator API Connections don't finish deploying until the relevant operator has approved your onboarding request. For some operators approval is a manual process, and so may take several days.
88
+
89
+
After an operator approves your onboarding request for an Operator API Connection, you are able to use APC with that Operator API Connection. This is the case even if your APC Gateway has other Operator API Connections that are not yet approved, with that operator or with another operator.
Copy file name to clipboardExpand all lines: articles/programmable-connectivity/azure-programmable-connectivity-using-network-apis.md
+51-41Lines changed: 51 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,17 +20,10 @@ Create an APC Gateway, following instructions in [Create an APC Gateway](azure-p
20
20
21
21
- Obtain the Resource ID of your APC Gateway. This can be found by navigating to the APC Gateway in the Azure portal, clicking `JSON View` in the top right, and copying the value of `Resource ID`. Note this as `APC_IDENTIFIER`.
22
22
- Obtain the URL of your APC Gateway. This can be found by navigating to the APC Gateway in the Azure portal, and obtaining the `Gateway base URL` under Properties. Note this as `APC_URL`.
23
-
24
-
## Obtain an authentication token
25
-
26
-
1. Follow the instructions at [How to create a Service Principal](/entra/identity-platform/howto-create-service-principal-portal) to create an App Registration that can be used to access your APC Gateway.
27
-
- For the step "Assign a role to the application", go to the APC Gateway in the Azure portal and follow the instructions from `3. Select Access Control (IAM)` onwards. Assign the new App registration the `Azure Programmable Connectivity Gateway Dataplane User` role.
28
-
- At the step "Set up authentication", select "Option 3: Create a new client secret". Note the value of the secret as `CLIENT_SECRET`, and store it securely (for example in an Azure Key Vault).
29
-
- After you have created the App registration, copy the value of Client ID from the Overview page, and note it as `CLIENT_ID`.
30
-
2. Navigate to "Tenant Properties" in the Azure portal. Copy the value of Tenant ID, and note it as `TENANT`.
31
-
3. Obtain a token from your App Registration. This can be done using an HTTP request, following the instructions in the [documentation](/entra/identity-platform/v2-oauth2-client-creds-grant-flow#first-case-access-token-request-with-a-shared-secret). Alternatively, you can use an SDK (such as those for [Python](/entra/msal/python/), [.NET](/entra/msal/dotnet/), and [Java](/entra/msal/java/)).
32
-
- When asked for `client_id`, `client_secret`, and `tenant`, use the values obtained in this process. Use `https://management.azure.com//.default` as the scope.
33
-
4. Note the value of the token you have obtained as `APC_AUTH_TOKEN`.
23
+
- APC uses [Azure RBAC](/azure/role-based-access-control/overview) to control access. Choose the identity that you are going to use to access APC. This can be your own user identity, a [Service Principal](/entra/identity-platform/app-objects-and-service-principals), or a [Managed Identity](/entra/identity/managed-identities-azure-resources/overview). Add the role assignment `Azure Programmable Connectivity Gateway Dataplane User` for your chosen identity over a scope that includes your APC Gateway (e.g. the APC Gateway itself, the Resource Group that contains it, or the Subscription that contains it). For more details, see the following instructions:
24
+
-[Assign Azure roles using the Azure portal](/azure/role-based-access-control/role-assignments-portal)
25
+
-[Assign Azure roles using Azure CLI](/azure/role-based-access-control/role-assignments-cli)
26
+
-[Assign Azure roles using Azure PowerShell](/azure/role-based-access-control/role-assignments-powershell)
34
27
35
28
## Use an API
36
29
@@ -41,17 +34,6 @@ Create an APC Gateway, following instructions in [Create an APC Gateway](azure-p
41
34
- Phone number: a phone number in E.164 format (starting with country code), optionally prefixed with '+'.
42
35
- Hashed phone number: the SHA-256 hash, in hexadecimal representation, of a phone number
43
36
44
-
#### Headers
45
-
46
-
All requests must contain the following headers:
47
-
48
-
-`Authorization`: This must have the value of `<APC_AUTH_TOKEN>` obtained in [Obtain an authentication token](#obtain-an-authentication-token).
49
-
-`apc-gateway-id`: This must have the value of `<APC_IDENTIFIER>` obtained in [Prerequisites](#prerequisites).
50
-
51
-
Requests may also contain the following optional header:
52
-
53
-
-`x-ms-client-request-id`: This is a unique ID to identify the specific request. This is useful for diagnosing and fixing errors.
54
-
55
37
#### Network identifier
56
38
57
39
Each request body contains the field `networkIdentifier`. This object contains the fields `identifierType` and `identifier`. These values are used to identify which Network a request should be routed to.
@@ -63,17 +45,45 @@ APC can identify the correct Network in one of three ways:
63
45
64
46
| Operator | NetworkCode |
65
47
| -------- | ----------- |
66
-
| Claro Brazil | Claro_Brazil |
67
-
| Telefonica Brazil | Telefonica_Brazil |
68
-
| TIM Brazil | Tim_Brazil |
69
-
| Orange Spain | Orange_Spain |
70
48
| Telefonica Spain | Telefonica_Spain |
71
49
72
-
### Retrieve the last time that a SIM card was changed
50
+
### Contact APC using an SDK
73
51
74
-
Make a POST request to the endpoint `https://<APC_URL>/sim-swap/sim-swap:verify`.
52
+
You can use a .NET SDK to contact APC. For more information and usage samples, see the [documentation](/dotnet/api/overview/azure/communication.programmableconnectivity-readme).
53
+
54
+
If you use the .NET SDK, it is recommended that you also use the [.NET Entra Authentication SDK](/entra/msal/dotnet/).
55
+
56
+
### Contact APC using HTTP requests
57
+
58
+
#### Obtain an auth token
59
+
60
+
To contact APC using HTTP requests, you must obtain an auth token, and set the header `Authorization` to the value of this token. There are numerous ways to do this. Some examples are shown below.
61
+
62
+
# [Obtain a token for a Service Principal](#tab/service-principal)
63
+
64
+
To obtain a token for a Service Principal, follow instructions in the [Entra documentation](/entra/identity-platform/v2-oauth2-client-creds-grant-flow#get-a-token)
75
65
76
-
It must contain all common headers specified in [Headers](#headers).
66
+
# [Obtain a token for your own user identity](#tab/user-identity)
67
+
68
+
Obtain a token for your own user identity using the Azure CLI command [get-access-token](/cli/azure/account?view=azure-cli-latest#az-account-get-access-token&preserve-view=true) or the PowerShell command [Get-AzAccessToken](/powershell/module/az.accounts/get-azaccesstoken). Set the `--resource` parameter (in Azure CLI) or the `-ResourceUrl` parameter (in PowerShell) to `https://management.azure.com/`.
69
+
70
+
---
71
+
72
+
#### Set other headers
73
+
74
+
All requests must contain the following header:
75
+
76
+
-`apc-gateway-id`: This must have the value of `<APC_IDENTIFIER>` obtained in [Prerequisites](#prerequisites).
77
+
78
+
Requests may also contain the following optional header:
79
+
80
+
-`x-ms-client-request-id`: This is a unique ID to identify the specific request. This is useful for diagnosing and fixing errors.
81
+
82
+
#### Retrieve the last time that a SIM card was changed
83
+
84
+
Make a POST request to the endpoint `https://<APC_URL>/sim-swap/sim-swap:retrieve`.
85
+
86
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
77
87
78
88
The body of the request must take the following form. Replace the example values with real values.
79
89
@@ -101,11 +111,11 @@ The response is of the form:
101
111
102
112
`date` contains the timestamp of the most recent SIM swap in the `date-time` format defined in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6). `date` may be `null`: this means that the SIM has never been swapped, or has not been swapped within the timeframe that the Operator maintains data for.
103
113
104
-
### Verify that a SIM card has been swapped in a certain time frame
114
+
####Verify that a SIM card has been swapped in a certain time frame
105
115
106
-
Make a POST request to the endpoint `https://<APC_URL>/sim-swap/sim-swap:retrieve`.
116
+
Make a POST request to the endpoint `https://<APC_URL>/sim-swap/sim-swap:verify`.
107
117
108
-
It must contain all common headers specified in [Headers](#headers).
118
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
109
119
110
120
The body of the request must take the following form. Replace the example values with real values.
111
121
@@ -136,11 +146,11 @@ The response is of the form:
136
146
137
147
`verificationResult` is a boolean, which is true if the SIM has been swapped in the specified time period, and false otherwise.
138
148
139
-
### Verify the location of a device
149
+
####Verify the location of a device
140
150
141
151
Make a POST request to the endpoint `https://<APC_URL>/device-location/location:verify`.
142
152
143
-
It must contain all common headers specified in [Headers](#headers).
153
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
144
154
145
155
The body of the request must take one of the following forms, which vary on the format used to identify the device. Replace the example values with real values.
146
156
@@ -234,17 +244,17 @@ The response is of the form:
234
244
235
245
`verificationResult` is a boolean, which is true if the device is within a certain distance (given by `accuracy`) of the given location, and false otherwise.
236
246
237
-
### Verify the number of a device
247
+
####Verify the number of a device
238
248
239
249
Number verification is different to other APIs, as it requires interaction with a frontend application (i.e. an application running on a device) to verify the number of that device, as part of a flow referred to as "frontend authorization". This means two separate calls to APC must be made: the first to trigger frontend authorization, and the second to request the desired information.
240
250
241
251
To use number verification functionality, you must expose an endpoint on the backend of your application that is accessible from your application's frontend. This endpoint is used to pass the result of frontend authorization to the backend of your application. Note the full URL to this endpoint as `REDIRECT_URI`.
242
252
243
-
####Call 1
253
+
##### Frontend authorization call
244
254
245
255
Make a POST request to the endpoint `https://<APC_URL>/number-verification/number:verify`.
246
256
247
-
It must contain all common headers specified in [Headers](#headers).
257
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
248
258
249
259
The body of the request must take one of the following forms. Replace the example values with real values.
250
260
@@ -284,13 +294,13 @@ At the end of the authorization flow, the Network returns a 302 redirect. This r
284
294
285
295
The frontend of your application must follow this `redirectUri`. This delivers the `apcCode` to your application's backend.
286
296
287
-
####Call 2
297
+
##### Number Verification call
288
298
289
299
At the end of Call 1, your frontend made a request to the endpoint exposed at `redirectUri` with a parameter `apcCode`. Your backend must obtain the value of `apcCode` and use it in the second call to APC.
290
300
291
301
Make a POST request to the endpoint `https://<APC_URL>/number-verification/number:verify`.
292
302
293
-
It must contain all common headers specified in [Headers](#headers).
303
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
294
304
295
305
The body of the request must take the following form. Replace the value of `apcCode` with the value obtained as a result of the authorization flow.
296
306
@@ -310,11 +320,11 @@ The response is of the form:
310
320
311
321
`verificationResult` is a boolean, which is true if the device has the number (or hashed number) specified in Call 1, and false otherwise.
312
322
313
-
### Obtain the Network of a device
323
+
####Obtain the network of a device
314
324
315
325
Make a POST request to the endpoint `https://<APC_URL>/device-network/network:retrieve`.
316
326
317
-
It must contain all common headers specified in [Headers](#headers).
327
+
It must contain a [bearer token](#obtain-an-auth-token) and [other required headers](#set-other-headers).
318
328
319
329
The body of the request must take the following form. Replace the example values with real values.
0 commit comments