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/cost-management-billing/reservations/azure-openai.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ ms.reviewer: primittal
6
6
ms.service: cost-management-billing
7
7
ms.subservice: reservations
8
8
ms.topic: concept-article
9
-
ms.date: 08/08/2024
9
+
ms.date: 08/12/2024
10
10
ms.author: banders
11
11
# customer intent: As a billing administrator, I want to learn about saving costs with Microsoft Azure OpenAI Service Provisioned Reservations and buy one.
12
12
---
13
13
14
14
# Save costs with Microsoft Azure OpenAI Service Provisioned Reservations
15
15
16
-
You can save money on Azure OpenAI provisioned throughput by committing to a reservation for your provisioned throughput units (PTUs) usage for a duration of one month or one year. This article explains how you can save money with Azure OpenAI Service Provisioned Reservations. For more information about Azure OpenAI PTUs, see [Provisioned throughput units onboarding](https://aka.ms/oai/docs/ptum-onboarding).
16
+
You can save money on Azure OpenAI provisioned throughput by committing to a reservation for your provisioned throughput units (PTUs) usage for a duration of one month or one year. This article explains how you can save money with Azure OpenAI Service Provisioned Reservations. For more information about Azure OpenAI PTUs, see [Provisioned throughput units onboarding](../../ai-services/openai/how-to/provisioned-throughput-onboarding.md).
17
17
18
18
To purchase an Azure OpenAI reservation, you choose an Azure region, quantity, and then add the Azure OpenAI SKU to your cart. Then you choose the quantity of provisioned throughput units that you want to purchase.
Copy file name to clipboardExpand all lines: articles/iot-operations/create-edge-apps/howto-deploy-dapr.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Azure IoT Operations supports two of these building blocks, powered by [MQTT bro
20
20
- Publish and subscribe
21
21
- State management
22
22
23
-
To use the Dapr pluggable components, define the component spec for each of the APIs and then [register this to the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
23
+
To use the Dapr pluggable components, define the component spec for each of the APIs and then [register with the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
24
24
25
25
## Install Dapr runtime
26
26
@@ -44,15 +44,15 @@ To create the yaml file, use the following component definitions:
44
44
> [!div class="mx-tdBreakAll"]
45
45
> | Component | Description |
46
46
> |-|-|
47
-
> |`metadata.name`| The component name is important and is how a Dapr application references the component. |
48
-
> | `metadata.annotations` | Component annotations used by Dapr sidecar injector, defining the image locationand required volume mounts
49
-
> |`spec.type`|[The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which needs to be declared exactly as shown |
50
-
> |`spec.metadata.keyPrefix`| Defines the key prefix used when communicating to the statestore backend. See the[Dapr documentation](https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-share-state) for more information |
51
-
> |`spec.metadata.hostname`| The MQTT broker hostname. Defaults to`aio-mq-dmqtt-frontend`|
52
-
> |`spec.metadata.tcpPort`| The MQTT broker port number. Default is `8883`|
53
-
> |`spec.metadata.useTls`| Define if TLS is used by the MQTT broker. Defaults to`true`|
54
-
> |`spec.metadata.caFile`| The certificate chain path for validating the MQTT broker. Required if `useTls` is `true`. This file must be mounted in the pod with the specified volume name |
55
-
> |`spec.metadata.satAuthFile `| The Service Account Token (SAT) file is used to authenticate the Dapr components with the MQTT broker. This file must be mounted in the pod with the specified volume name |
47
+
> |`metadata:name`| The component name is important and is how a Dapr application references the component. |
48
+
> |`metadata:annotations:dapr.io/component-container`| Component annotations used by Dapr sidecar injector, defining the image location, volume mounts and logging configuration |
49
+
> |`spec:type`|[The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which needs to be declared exactly as shown |
50
+
> |`spec:metadata:keyPrefix`| Defines the key prefix used when communicating to the statestore backend. See more information, see[Dapr documentation](https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-share-state) for more information |
51
+
> |`spec:metadata:hostname`| The MQTT broker hostname. Default is`aio-mq-dmqtt-frontend`|
52
+
> |`spec:metadata:tcpPort`| The MQTT broker port number. Default is `8883`|
53
+
> |`spec:metadata:useTls`| Define if TLS is used by the MQTT broker. Default is`true`|
54
+
> |`spec:metadata:caFile`| The certificate chain path for validating the MQTT broker. Required if `useTls` is `true`. This file must be mounted in the pod with the specified volume name |
55
+
> |`spec:metadata:satAuthFile `| The Service Account Token (SAT) file is used to authenticate the Dapr components with the MQTT broker. This file must be mounted in the pod with the specified volume name |
56
56
57
57
1. Save the following yaml, which contains the Azure IoT Operations component definitions, to a file named `components.yaml`:
58
58
@@ -70,6 +70,10 @@ To create the yaml file, use the following component definitions:
Copy file name to clipboardExpand all lines: articles/iot-operations/create-edge-apps/howto-develop-dapr-apps.md
+20-19Lines changed: 20 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The first step is to write an application that uses a Dapr SDK to publish/subscr
36
36
37
37
After you finish writing the Dapr application, build the container:
38
38
39
-
1.To package the application into a container, run the following command:
39
+
1.Package the application into a container with the following command:
40
40
41
41
```bash
42
42
docker build . -t my-dapr-app
@@ -50,17 +50,20 @@ After you finish writing the Dapr application, build the container:
50
50
51
51
## Deploy a Dapr application
52
52
53
-
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition contains the volumes required to deploy the application along with the required containers. This deployment utilizes the Dapr sidecar injector to automatically add the pluggable component pod.
53
+
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition contains volumes for SAT authentication and TLS certificate chain, and utilizes Dapr sidecar injection to automatically add the pluggable components to the Pod.
54
54
55
-
The yaml contains both a ServiceAccount, used to generate SATs for authentication with MQTT broker and the Dapr application Deployment.
56
-
57
-
To create the yaml file, use the following definitions:
55
+
The following definition components might require customization to your specific application:
58
56
59
57
>| Component | Description |
60
58
>|-|-|
61
-
>|`volumes.mqtt-client-token`| The System Authentication Token used for authenticating the Dapr pluggable components with the MQTT broker |
62
-
>|`volumes.aio-ca-trust-bundle`| The chain of trust to validate the MQTT broker TLS cert. This defaults to the test certificate deployed with Azure IoT Operations |
63
-
>|`containers.mq-dapr-app`| The Dapr application container you want to deploy |
59
+
>|`template:metadata:annotations:dapr.io/inject-pluggable-components`| Allows the IoT Operations pluggable components to be [automatically injected](https://docs.dapr.io/operations/components/pluggable-components-registration/) into the pod |
60
+
>|`template:metadata:annotations:dapr.io/app-port`| Tells Dapr which port your application is listening on. If your application us not using this feature (such as a pubsub subscription), then remove this line |
61
+
>|`volumes:mqtt-client-token`| The System Authentication Token used for authenticating the Dapr pluggable components with the MQTT broker |
62
+
>|`volumes:aio-ca-trust-bundle`| The chain of trust to validate the MQTT broker TLS cert. This defaults to the test certificate deployed with Azure IoT Operations |
63
+
>|`containers:mq-dapr-app`| The Dapr application container you want to deploy |
64
+
65
+
> [!CAUTION]
66
+
> If your Dapr application is not listening for traffic from the Dapr sidecar, then remove the `dapr.io/app-port` and `dapr.io/app-protocol` [annotations](https://docs.dapr.io/reference/arguments-annotations-overview/) otherwise the Dapr sidecar will fail to initialize.
64
67
65
68
1. Save the following yaml to a file named `dapr-app.yaml`:
66
69
@@ -76,21 +79,20 @@ To create the yaml file, use the following definitions:
76
79
apiVersion: apps/v1
77
80
kind: Deployment
78
81
metadata:
79
-
name: mq-dapr-app
82
+
name: my-dapr-app
80
83
namespace: azure-iot-operations
81
84
spec:
82
-
replicas: 1
83
85
selector:
84
86
matchLabels:
85
-
app: mq-dapr-app
87
+
app: my-dapr-app
86
88
template:
87
89
metadata:
88
90
labels:
89
-
app: mq-dapr-app
91
+
app: my-dapr-app
90
92
annotations:
91
93
dapr.io/enabled: "true"
92
94
dapr.io/inject-pluggable-components: "true"
93
-
dapr.io/app-id: "mq-dapr-app"
95
+
dapr.io/app-id: "my-dapr-app"
94
96
dapr.io/app-port: "6001"
95
97
dapr.io/app-protocol: "grpc"
96
98
spec:
@@ -124,23 +126,22 @@ To create the yaml file, use the following definitions:
124
126
kubectl get pods -w
125
127
```
126
128
127
-
The workload pod should report all pods running after a short interval, as shown in the following example output:
129
+
The pod should report three containers running after a short interval, as shown in the following example output:
128
130
129
131
```output
130
-
pod/dapr-workload created
131
132
NAME READY STATUS RESTARTS AGE
132
133
...
133
-
dapr-workload 3/3 Running 0 30s
134
+
my-dapr-app 3/3 Running 0 30s
134
135
```
135
136
136
137
## Troubleshooting
137
138
138
-
If the application doesn't start or you see the pods in `CrashLoopBackoff`, the logs for `daprd` are most helpful. The `daprd` is a container that automatically deploys with your Dapr application.
139
+
If the application doesn't start or you see the containers in `CrashLoopBackoff` state, the log for the `daprd` container often contains useful information.
139
140
140
-
Run the following command to view the logs:
141
+
Run the following command to view the logs for the daprd component:
[MQTTnet](https://dotnet.github.io/MQTTnet/) is an open-source, high performance .NET library for MQTT based communication. This article uses a Kubernetes service account token and MQTTnet to connect to MQTT broker. You should use service account tokens to connect to in-cluster clients.
19
+
[MQTTnet](https://dotnet.github.io/MQTTnet/) is an open-source, high performance .NET library for MQTT based communication. This article uses a Kubernetes service account token and MQTTnet to connect to MQTT broker. You should use service account tokens to connect in-cluster applications.
20
20
21
21
## Sample code
22
22
23
23
The [sample code](https://github.com/Azure-Samples/explore-iot-operations/tree/main/samples/mqtt-client-dotnet/Program.cs) performs the following steps:
24
24
25
-
1. Creates an MQTT client using the `MQTTFactory` class:
25
+
1. Creates an MQTT client using the `MqttFactory` class:
1. AlloptionsfortheMQTTclientarebundledintheclassnamed`MqttClientOptions`. It's possible to fill options manually in code via the properties but you should use the `MqttClientOptionsBuilder` as advised in the [client](https://github.com/dotnet/MQTTnet/wiki/Client) documentation. The following code shows how to use the builder with the following options:
41
+
1. TheMQTTclientoptionsareconfiguredusingthe `MqttClientOptions`class. Usingthe `MqttClientOptionsBuilder` asadvisedinthe [client](https://github.com/dotnet/MQTTnet/wiki/Client) documentation is the advised way of setting the options:
47
42
48
43
```csharp
49
-
# Create TCP based options using the builder amd connect to broker
Console.WriteLine("The MQTT client published a message.");
74
66
```
75
67
76
68
## Pod specification
77
69
78
-
The `serviceAccountName` fieldinthepodconfigurationmustmatchtheserviceaccountassociatedwiththetokenbeingused. Also, notethe `serviceAccountToken.expirationSeconds` issetto **86400 seconds**, andonceitexpires, youneedtoreloadthetokenfromdisk. Thislogicisn't currently implemented in the sample.
70
+
The `serviceAccountName` fieldinthepodconfigurationmustmatchtheserviceaccountassociatedwiththetokenbeingused. Also, notethe `serviceAccountToken.expirationSeconds` issetto **86400 seconds**, andonceitexpires, youneedtoreloadthetokenfromdisk. Thislogicisn't implemented in this sample.
79
71
80
72
```yaml
81
73
apiVersion:v1
74
+
kind:ServiceAccount
75
+
metadata:
76
+
name:mqtt-client
77
+
namespace:azure-iot-operations
78
+
79
+
---
80
+
apiVersion:v1
82
81
kind:Pod
83
82
metadata:
84
83
name:mqtt-client-dotnet
85
-
labels:
86
-
app:publisher
84
+
namespace:azure-iot-operations
87
85
spec:
88
86
serviceAccountName:mqtt-client
89
87
90
-
volumes:
91
-
# SAT token used to authenticate between the application and the MQTT broker
92
-
-name:mqtt-client-token
93
-
projected:
94
-
sources:
95
-
-serviceAccountToken:
96
-
path:mqtt-client-token
97
-
audience:aio-mq-dmqtt
98
-
expirationSeconds:86400
99
-
100
-
# Certificate chain for the application to validate the MQTT broker
101
-
-name:aio-mq-ca-cert-chain
102
-
configMap:
103
-
name:aio-mq-ca-cert-chain
88
+
volumes:
89
+
90
+
# SAT token used to authenticate between the application and the MQTT broker
91
+
-name:mqtt-client-token
92
+
projected:
93
+
sources:
94
+
-serviceAccountToken:
95
+
path:mqtt-client-token
96
+
audience:aio-mq
97
+
expirationSeconds:86400
98
+
99
+
# Certificate chain for the application to validate the MQTT broker
To run the sample, follow the instructions in its [README](https://github.com/Azure-Samples/explore-iot-operations/tree/main/samples/mqtt-client-dotnet).
0 commit comments