Skip to content

deislabs/azure-sdk-for-rust-wasi-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Azure services from WASI modules

This repo contains samples for using the Azure Rust SDK from WASI modules, using the wasi-experimental-http crate. The samples are slightly modified versions of those from the upstream SDK repository. Note that not all SDKs are compilable to wasm32-wasi, and this repo should be updated as more compatible SDKs are added.

The very early work in progress can be tracked here.

Building

$ cargo target add wasm32-wasi
$ cargo build --target wasm32-wasi --release --bin blob
$ cargo build --target wasm32-wasi --release --bin cosmos
$ cargo build --target wasm32-wasi --release --bin eventgrid
$ cargo build --target wasm32-wasi --release --bin iothub

At this point, the easiest way to test the resulting module is to execute it using the helper binary that can be found here:

$ wasmtime-http target/wasm32-wasi/release/blob.wasm --env STORAGE_MASTER_KEY=<master-key> --env STORAGE_ACCOUNT=<storage-account> -a https://<storage-account>.blob.core.windows.net

$ wasmtime-http target/wasm32-wasi/release/cosmos.wasm --env COSMOS_MASTER_KEY=<master-key> --env COSMOS_ACCOUNT=<cosmos-account> -a https://<cosmos-account>.documents.azure.com

$ wasmtime-http target/wasm32-wasi/release/eventgrid.wasm --env TOPIC_HOST_NAME=<full-topic-hostname> --env TOPIC_KEY=<topic-key> -a https://<topic>.<location>.eventgrid.azure.net

$ wasmtime-http target/wasm32-wasi/release/iothub.wasm --env IOTHUB_CONNECTION_STRING=<connection-string-in-quotes> -a https://<iothub-account>.azure-devices.net

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages